package Day4;

import java.util.*;

public class Main {
    public static void main1(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] arr = new long[3];
        arr[0] = 0;
        arr[1] = 1;
        int ans = n;
        while(arr[2] < n){
            arr[2] = arr[0] + arr[1];
            ans = Math.min(ans, (int)Math.abs(arr[2] - n));
            arr[0] = arr[1];
            arr[1] = arr[2];
        }
        System.out.println(Math.min(ans, (int)Math.abs(arr[2] - n)));
    }


    StringBuilder sb = new StringBuilder();
    public boolean exist (String[] board, String word) {
        for(int i = 0; i < board.length; i++){
            for(int j = 0; j < board[i].length(); j++){
                if(board[i].charAt(j) == word.charAt(0)){
                    sb.append(word.charAt(0));
                    if(DFS(board, word, i, j, 1)){
                        return true;
                    }
                    sb.deleteCharAt(sb.length() - 1);
                }
            }
        }
        return false;
    }

    private boolean DFS(String[] board, String word, int i, int j, int next) {
        return true;
    }


    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[][] arr = new int[n][];
        arr[0] = new int[]{1};
        if(n < 2){
            System.out.println(1);
            return;
        }
        arr[1] = new int[]{1, 1};
        for(int i = 2; i < n; i++){
            arr[i] = new int[i + 1];
            arr[i][0] = 1;
            arr[i][i] = 1;
            for(int j = 1; j < arr[i].length - 1; j++){
                arr[i][j] = arr[i-1][j-1]+arr[i-1][j];
            }
        }
        for(int i = 0; i < arr.length; i++){
            for(int j = 0; j < arr[i].length; j++){
                System.out.printf("%5d ", arr[i][j]);
            }
            System.out.println();
        }
    }

}
